import {reqGetAddressInfo,reqGetOrderInfo} from "@/api"
const state = {
    address: [],
    order: {}
}
const actions = {
    async getAddressInfo({ commit }) {
        let result = await reqGetAddressInfo()
        if (result.data.code == 200) {
            commit("GETADDRESSINFO",result.data.data)
        }
    },
    async getOrderInfo({ commit }) {
        let result = await reqGetOrderInfo()
        if (result.data.code == 200) {
            commit("GETORDERINFO",result.data.data)
        }
    }
}
const mutations = {
    GETADDRESSINFO(state, address) {
        state.address=address
    },
    GETORDERINFO(state, order) {
        state.order=order
    }
}
const getters = {}
export default {
    state,
    actions,
    mutations,
    getters
}